#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time      :2021/7/16 14:03
# @Author    :cjw
from typing import Optional

from pydantic import BaseModel


class ItemBase(BaseModel):
	title: Optional[str] = None
	description: Optional[str] = None


class ItemCreate(ItemBase):
	title: str


class ItemUpdate(ItemBase):
	pass


class ItemInDBBase(ItemBase):
	id: Optional[int] = None
	title: str
	owner_id: int

	class Config:
		orm_mode = True


class Item(ItemInDBBase):
	pass


class ItemInDB(ItemInDBBase):
	pass
